package com.yuebao.converter;

import com.yuebao.model.pojo.Transaction;
import com.yuebao.param.AliPayParam;
import com.yuebao.utils.JsonUtils;

public class TransToAlipayDTO {
    
    public static String transToBizContent(Transaction transaction){
        AliPayParam aliPayParam = AliPayParam.builder()
                .out_trade_no(String.valueOf(transaction.getOrderNo()))
                .total_amount(transaction.getTradeMoney())
                .subject(transaction.getTransCategory())
                .product_code("FAST_INSTANT_TRADE_PAY")
                .build();
    
        return JsonUtils.writeValueAsString(aliPayParam);
    }
}
